﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="adminSearch.aspx.cs" Inherits="LibrarySystem.WebForm8" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
    <asp:Label ID="searchResCount" runat="server"></asp:Label>
    <asp:Panel runat="server" ID="bookListPanel" Visible="false">

        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="bookSearchList" OnPreRender="bookDataPager_PreRender">
        <Fields>
        <asp:NextPreviousPagerField ButtonType="Link" LastPageText="<<" PreviousPageText="<" ShowPreviousPageButton="True" FirstPageText="&lt;&lt;" ShowFirstPageButton="True" ShowNextPageButton="False" />
             <asp:NumericPagerField ButtonType="Link" ButtonCount="10" /> 
            <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="" NextPageText=">" ShowNextPageButton="True" LastPageText="&gt;&gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" />            
            </Fields>
        </asp:DataPager>

            <asp:ListView ID="bookSearchList" runat="server" OnDataBound="bookSearchList_DataBound">
                <LayoutTemplate> 
                    <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
                </LayoutTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1"  runat="server" OnCommand="booklistItem_Clicked" CommandName='<%#Eval("ISBN")%>'>
                        <table id="bookDetailCopies"> <tr><td id="adminSearchDetailOne"><%# Eval("Title") %></td></tr><tr><td id="adminSearchDetailTwo"><%# Eval("Author") %></td><td id="adminSearchDetailThree">ISBN: <%# Eval("ISBN") %></td><tr/></table>
                    </asp:LinkButton>
                </ItemTemplate>        
            </asp:ListView>
        <asp:DataPager ID="DataPager2" runat="server" PagedControlID="bookSearchList" OnPreRender="bookDataPager_PreRender" >
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Link" LastPageText="<<" PreviousPageText="<" ShowPreviousPageButton="True" FirstPageText="&lt;&lt;" ShowFirstPageButton="True" ShowNextPageButton="False" />
                <asp:NumericPagerField ButtonType="Link" ButtonCount="10" /> 
                <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="" NextPageText=">" ShowNextPageButton="True" LastPageText="&gt;&gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" />            
            </Fields>
        </asp:DataPager>
    </asp:Panel>

    <asp:Panel runat="server" ID="authorListPanel" Visible="false">
        <asp:DataPager ID="DataPager3" runat="server" PagedControlID="authorSearchList" OnPreRender="authorDataPager_PreRender">
        <Fields>
        <asp:NextPreviousPagerField ButtonType="Link" LastPageText="<<" PreviousPageText="<" ShowPreviousPageButton="True" FirstPageText="&lt;&lt;" ShowFirstPageButton="True" ShowNextPageButton="False" />
             <asp:NumericPagerField ButtonType="Link" ButtonCount="10" /> 
            <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="" NextPageText=">" ShowNextPageButton="True" LastPageText="&gt;&gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" />            
            </Fields>
        </asp:DataPager>
            <asp:ListView ID="authorSearchList" runat="server" OnDataBound="authorSearchList_DataBound">
                <LayoutTemplate> 
                    <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
                </LayoutTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1"  runat="server" OnCommand="authorlistItem_Clicked" CommandName='<%#Eval("Aid")%>'>
                        <table id="bookDetailCopies"><tr><td id="adminSearchDetailOne"><%# Eval("Aid") %></td><td id="adminSearchDetailTwo"><%# Eval("AuthorName") %></td><td id="adminSearchDetailThree"><%# Eval("BirthYear") %></td></tr></table>
                    </asp:LinkButton>
                </ItemTemplate>        
            </asp:ListView>
        <asp:DataPager ID="DataPager4" runat="server" PagedControlID="authorSearchList" OnPreRender="authorDataPager_PreRender" >
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Link" LastPageText="<<" PreviousPageText="<" ShowPreviousPageButton="True" FirstPageText="&lt;&lt;" ShowFirstPageButton="True" ShowNextPageButton="False" />
                <asp:NumericPagerField ButtonType="Link" ButtonCount="10" /> 
                <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="" NextPageText=">" ShowNextPageButton="True" LastPageText="&gt;&gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" />            
            </Fields>
        </asp:DataPager>
    </asp:Panel>


    <asp:Panel runat="server" ID="borrowerListPanel" Visible="false">
        <asp:DataPager ID="DataPager5" runat="server" PagedControlID="borrowerSearchList" OnPreRender="borrowerDataPager_PreRender">
        <Fields>
        <asp:NextPreviousPagerField ButtonType="Link" LastPageText="<<" PreviousPageText="<" ShowPreviousPageButton="True" FirstPageText="&lt;&lt;" ShowFirstPageButton="True" ShowNextPageButton="False" />
             <asp:NumericPagerField ButtonType="Link" ButtonCount="10" /> 
            <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="" NextPageText=">" ShowNextPageButton="True" LastPageText="&gt;&gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" />            
            </Fields>
        </asp:DataPager>
            <asp:ListView ID="borrowerSearchList" runat="server" OnDataBound="borrowerSearchList_DataBound">
                <LayoutTemplate> 
                    <tbody> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </tbody>
                </LayoutTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1"  runat="server" OnCommand="borrowerlistItem_Clicked" CommandName='<%#Eval("PersonId")%>'>
                        <table id="bookDetailCopies"><tr><td id="adminSearchDetailOne"><%# Eval("Name") %></td><td id="adminSearchDetailTwo"><%# Eval("Address") %></td></tr></table>
                    </asp:LinkButton>
                </ItemTemplate>        
            </asp:ListView>
        <asp:DataPager ID="DataPager6" runat="server" PagedControlID="borrowerSearchList" OnPreRender="borrowerDataPager_PreRender" >
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Link" LastPageText="<<" PreviousPageText="<" ShowPreviousPageButton="True" FirstPageText="&lt;&lt;" ShowFirstPageButton="True" ShowNextPageButton="False" />
                <asp:NumericPagerField ButtonType="Link" ButtonCount="10" /> 
                <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="" NextPageText=">" ShowNextPageButton="True" LastPageText="&gt;&gt;" ShowLastPageButton="True" ShowPreviousPageButton="False" />            
            </Fields>
        </asp:DataPager>
    </asp:Panel>
</asp:Content>
